Android: Added onSaveInstanceState#1185
Android: Added onSaveInstanceState#1185pulsejet merged 6 commits intopulsejet:masterfrom tenJirka:OrientationChengeFix
Conversation
|
After adding screenLayout into manifest, app works properly even on my phone + it handles better split screen transformations. Previous changes is not so much needed now, but in my opinion it is probably better to have them in the app as backup, if anything other will appear. |
|
Good catch. I'd remove the state saving if it's not required. Just saving the url is not sufficient state (that would require perfect deep linking, and there's other things that we rely on like browser history state). If it gets triggered it might give rise to more subtle bugs (having a more "noisy" issue is always better) |
|
Probably worth adding more props from here We should be able to handle basically any change. |
Changes done in this file is not need and was more like a hack
|
I understand. I removed the state saving and added all the props from the link you suggested (hope I understood you correctly). I left the fullscreen setting in onCreate() to compensate for opening from landscape. |
|
Thanks @tenJirka |
For some reason, I wasn´t able to find out why, on my phone (Pixel 7, android 14) is main activity always recreated when screen is rotated, and app always forget in which state it was. I was not able to replicate this behavior in android studio emulator, which is weird. It is really annoying so I decided to add feature to restore MainActivity from previous state.
For the same reason no full screen setting (hide status bar) was called so I added it to onCreate function. All edits would be called once on devices without this problem, which should be fine, and this will work as back up for devices which do have same problem.
Bonus is, that this will work every time, that for example split screen should now work better (App will not "restart").